window: Restructure gtk_window_destroy()
authorTimm Bäder <mail@baedert.org>
Wed, 13 May 2020 09:34:33 +0000 (11:34 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 13 May 2020 10:18:09 +0000 (12:18 +0200)
commit9149c79f250c03e16631262209633f9d93c3c032
treeff914d983db340868d2e0f8ecb91bbafd77de4dd
parenta50bf27cf2daf58e4f04dc19041b8bfd7294aa9d
window: Restructure gtk_window_destroy()

The previous code was unreffing the window twice, which caused problems
during dialog destruction. Move to g_list_store_find instead of
iterating manually.

ref() the window before and unref() after. g_list_store_remove will
actually unref() the window, since the toplevel_list owns its own
reference.

Fixes #2741
Fixes #2742
gtk/gtkwindow.c